﻿<UserControl x:Class="CharacterCreation.Views.RaceListView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:controls="clr-namespace:CharacterCreation.Controls"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
    
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <controls:ListBox ItemsSource="{Binding Races}" SelectedItem="{Binding CurrentRace, Mode=TwoWay}" Background="Transparent" Grid.Row="1">
            <controls:ListBox.CustomItemTemplate>
                <DataTemplate>
                    <Border Background="Transparent">
                        <TextBlock Text="{Binding Name}" Margin="5" Foreground="{StaticResource mainForegroundBrush}"/>
                    </Border>
                </DataTemplate>
            </controls:ListBox.CustomItemTemplate>

            <controls:ListBox.SelectedItemTemplate>
                <DataTemplate>
                    <Border Background="AliceBlue">
                        <TextBlock Text="{Binding Name}" Margin="5" Foreground="{StaticResource backgroundBrush}"/>
                    </Border>
                </DataTemplate>
            </controls:ListBox.SelectedItemTemplate>
        </controls:ListBox>
    </Grid>
</UserControl>
